﻿import 'package:fluent_ui/fluent_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:get/get.dart';
import 'package:simu_studio/app/modules/home/controllers/home_controller.dart';
import 'package:window_manager/window_manager.dart';

class HomeUI extends StatelessWidget {
  HomeUI({super.key});

  final viewKey = GlobalKey();

  @override
  Widget build(BuildContext context) {
    assert(debugCheckHasFluentTheme(context));
    HomeController homeController = Get.find();
    return Obx(() => FluentTheme(
          data: FluentTheme.of(context),
          child: Directionality(
            textDirection: TextDirection.ltr,
            child: NavigationView(
              key: viewKey,
              pane: NavigationPane(
                // header: Text('ApplicationName'.tr),
                selected: homeController.selectIndex.value,
                onChanged: (index) => homeController.setSelectedIndex(index),
                displayMode: PaneDisplayMode.open,
                items: homeController.paneItems,
                size: const NavigationPaneSize(
                    openMaxWidth: 150, openMinWidth: 100),
              ),
              transitionBuilder: (child, animation) {
                return DrillInPageTransition(
                  animation: animation,
                  child: child,
                );
              },
            ),
          ),
        ));
  }
}
